﻿using FoodModel;
using J.FoodManageSet.Application.Command.TableNumCommand;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace J.FoodManageSet.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class TanleNumController : ControllerBase
    {
        private readonly IMediator _mediator;

        public TanleNumController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 桌号添加或修改
        /// </summary>
        [HttpPost]
        public async Task<int> NunAddUpdate(TableNumAddCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 桌号批量删除
        /// </summary>
        [HttpPost]
        public async Task<int> NunDelete(TableNumDeleteCommand command)
        {
            return await _mediator.Send(command);
        }
        /// <summary>
        /// 桌号批量删除
        /// </summary>
        [HttpPost]
        public async Task<int> NunUpDate(TableNumUpDateCommand command)
        {
            return await _mediator.Send(command);
        }
      
    }
}
